/**
 * @Author admin
 * @Date 2019/3/22 9:14
 */

public class Undergraduate extends Student {
    Undergraduate(String name){
        super(name);
        this.type="本科生";
    }
    @Override
    public String calculateGrade() {
        float sum=(courses[0]+courses[1]+courses[2])/3;
        if (sum>=90){
            return "优秀";
        }
        else if (sum>=80&sum<90) {
            return "良好";
        }
        else if (sum>=70&sum<80){
            return "中等";
        }
        else if (sum>=60&sum<70){
            return "及格";
        }
        else {
            return "不及格";
        }
    }
}

